When a task is triggered, it automatically creates a dataset called AMTrigger. This dataset can be used within a task to determine whether or not the task was started by a trigger, which trigger it was, and properties of that trigger. AMTrigger is a standard AutoMate dataset and can be used much like the datasets created by the SQL Query and E-mail action. The fields of AMTrigger can be used to examine properties of the trigger that caused the task to launch. For example, using a Messagebox action with the title set to:
%AmTrigger.Trigger%
would display a messagebox where the title contained the name of the trigger that launched the task.
The total number of fields and what they are called are dependant on the trigger that launched the task, but every instance of AMTrigger has the following fields:
The name of the trigger that started the task. For example, if the Key Watcher started the task, this value would be AMHOTKEY. See each trigger's help topic for specifics.
On Windows NT/2000/XP, if the workstation was locked when task started, this value will be 1. Otherwise, it will be 0. On Windows 98/SP/ME, this value is always 0.
On Windows NT/2000/XP, if the workstation was logged off when task started, this value will be 1. Otherwise, it will be 0. On Windows 98/SP/ME, this value is always 0.